<template>
    <div class="navCont">
        <p @click="back">返回</p>
        <div class="NavWraper">
            <div class="header">
                <div class="header_item">菜单一</div>
                <div class="header_item">菜单二</div>
                <div class="header_item">菜单三</div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    methods: {
        back() {
            this.$router.push({
                path: '/'
            })
        }
    }
}
</script>

<style lang="less">
.NavWraper{
    position: relative;
    .header{
        position: absolute;
        display: flex;
        .header_item{
            padding: 20px;
            position:relative;
            cursor: pointer;
            transition: 0.2s all linear;
        }
        .header_item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 100%;
            width: 0;
            height: 100%;
            border-bottom: 2px solid #000;
            transition: 0.2s all linear;
        }
        .header_item:hover::before{
            width: 100%;
            top: 0;
            left: 0;
            transition-delay: 0.1s;
            border-bottom-color: #000;
            z-index: -1;
        }
        .header_item:hover ~ .header_item::before {
            left: 0;
        }
    }
}
</style>
